package fr.umlv.escapeir.structure;

import java.awt.Color;
import java.util.Arrays;
import java.util.List;

import org.jbox2d.collision.shapes.CircleShape;
import org.jbox2d.collision.shapes.PolygonShape;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.BodyType;
import org.jbox2d.dynamics.FixtureDef;
import org.jbox2d.dynamics.joints.RevoluteJoint;
import org.jbox2d.dynamics.joints.RevoluteJointDef;

import fr.umlv.escapeir.painters.WorldPainter;
import fr.umlv.escapeir.painters.WorldGraphics2D;

public class Ship2 implements Structure {
	
	private Body bodyCenter;
	private Body bodyLeft;
	private Body bodyRight;
	private WorldPainter painter;
	private final CircleShape cshape;
	private final PolygonShape pshapeLeft;
	private final PolygonShape pshapeRight;
	private final BodyDef bdef;
	private final FixtureDef fdefCenter;
	private final FixtureDef fdefLeft;
	private final FixtureDef fdefRight;
	
	public Ship2 (float x, float y, float radius) {
		bdef = new BodyDef();
		bdef.type = BodyType.DYNAMIC;
		bdef.position.set(x, y);
		
		painter = new WorldPainter() {
			@Override
			public void render(WorldGraphics2D painter) {
				
			}
		};
	}

	@Override
	public WorldPainter getPainter() {
		return painter;
	}

	@Override
	public void setPainter(WorldPainter painter) {
		this.painter = painter;
	}

	@Override
	public void finalize(Body body, BodyDef bdef) {
	}

	@Override
	public List<BodyDef> getBodyDefinitions() {
		return Arrays.asList(bdefCenter, bdefLeft);
	}

}
